package com.muyu.product.service.impl;

import java.util.List;

import com.muyu.common.core.utils.ObjUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import com.muyu.product.mapper.AsAttributeGroupMapper;
import com.muyu.product.domain.AsAttributeGroup;
import com.muyu.product.service.AsAttributeGroupService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;

/**
 * 属性与组中间Service业务层处理
 *
 * @author DongZeLiang
 * @date 2024-02-27
 */
@Slf4j
@Service
public class AsAttributeGroupServiceImpl extends ServiceImpl<AsAttributeGroupMapper, AsAttributeGroup>  implements AsAttributeGroupService {

    /**
     * 查询属性与组中间列表
     *
     * @param asAttributeGroup 属性与组中间
     * @return 属性与组中间
     */
    @Override
    public List<AsAttributeGroup> list(AsAttributeGroup asAttributeGroup) {
        LambdaQueryWrapper<AsAttributeGroup> queryWrapper = new LambdaQueryWrapper<>();


        if (ObjUtils.notNull(asAttributeGroup.getGroupId())){
            queryWrapper.eq(AsAttributeGroup::getGroupId, asAttributeGroup.getGroupId());
        }

        if (ObjUtils.notNull(asAttributeGroup.getAttributeId())){
            queryWrapper.eq(AsAttributeGroup::getAttributeId, asAttributeGroup.getAttributeId());
        }

        return list(queryWrapper);
    }
}
